package com.example.sky20.dao;

import com.example.sky20.util.DBConnection;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class AdminDao {
    DBConnection DBConn = new DBConnection();
    public boolean CheckLogin(String s1,String s2){
        throws SQLException{
            Connection conn = DBConn.getConn();
            Statement stmt = conn.createStatement();
            ResultSet re = null;
            boolean ok = true;
            String sql = "select * from admin where"+
                    "AdminName = '"+s1+ " 'and"+"AdminPwd = '"+s2+"'";
            rs  = stmt.executeQuery(sql);
            if (!rs.next()){
                ok = false;
            }
            return ok;
        }
    }
}
